package iotwisp.school.system.service;

import iotwisp.school.system.qo.FileQO;
import iotwisp.base.orm.BaseDao;
import org.hibernate.Criteria;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import iotwisp.school.system.command.CreateFileSCmd;
import iotwisp.school.system.entity.File;

@Service
@Transactional
public class FileService extends BaseDao<File, FileQO> {

    public File createFile(CreateFileSCmd cmd) {

        //  新建文件信息
        File file = new File();
        file.create(cmd);
        //  保存文件信息
        save(file);

        return file;
    }


    @Override
    protected Criteria buildCriteria(Criteria criteria, FileQO qo) {
        return criteria;
    }

    @Override
    protected Class<File> getEntityClass() {
        return File.class;
    }

}
